package com.jixin.dao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class DaoUtils {

	private static ApplicationContext context;
	 
	static{
//		String filepath = DaoUtils.class.getResource("/config/spring-config.xml").getPath();
//		System.out.println(filepath);
		context = new FileSystemXmlApplicationContext("classpath:config/spring-config.xml");
	}
	
    public static Object getBean(String serviceName){
          return context.getBean(serviceName);
    }
    
    public static ApplicationContext getContext(){
    	return context;
    }
    
	public static void main(String[] args) {
		System.out.println(context);
	}
	
}
